<!doctype html>
<html xmlns:th="www.thymeleaf.org">
<meta charset="utf-8">
<head th:replace="index::head"></HEAD>
<style>
.layui-colla-content img{
	max-width: 100%
}

</style>
<BODY>
	<header th:replace="index::#ph"></header>
	<!--      主体        -->
	<main>
		<!--      导航        -->
		<div style="padding: 3px 8px">
			<span class="layui-breadcrumb">
				<a href="/">作业论坛首页</a>
				<a>
					<cite>作业完成情况</cite>
				</a>
			</span>
		</div>
		<!--      新帖        -->
		<DIV class="t">
			<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
			  <legend><a :href="'to_detail?id='+param('id')">{{task.clsSn}}班：{{task.name}}</a></legend>
			</fieldset>
			<div class="layui-collapse" lay-accordion>
			  	<div class="layui-colla-item" v-for="(o,i) in users.content">
			    	<div class="layui-colla-title layui-row">
			    		<div class="layui-col-md1">{{i+1}}</div>
			    		<div class="layui-col-md3">{{o.name}}</div>
			    		<div class="layui-col-md3">
			    			<span v-if=" ! o.log.progress" class="layui-badge layui-bg-orange">
								<a v-if="o.log.progress==0" :href="o.id==uid?('to_tasklog?id='+o.log.id):'javascript:;'">未完成</a>
								<a v-else :href="o.id==uid?('to_tasklog?task.id='+param('id')):'javascript:;'">未完成</a>
							</span>
							<span v-else-if="o.log.progress==100" class="layui-badge layui-bg-green">
								<a :href="'to_tasklog?id='+o.log.id">已完成</a>
							</span>
							<span v-else class="layui-badge layui-bg-cyan">
								<a :href="'to_tasklog?id='+o.log.id">完成中</a>
							</span>
						</div>
			    		<div class="layui-col-md3">{{o.log.progress?o.log.inTime:"---"}}</div>
			    		<div class="layui-col-md2">
			    			<btn th:if="${session?.loginedUser?.role}==0" v-if="o.log.id>0 && !o.log.state" @click="c(o.log)">&nbsp;&nbsp;检&nbsp;查&nbsp;&nbsp;</btn>
			    			<span v-if="o.log.state==1">已阅</span>
						</div>
			    	</div>
			    	<div class="layui-colla-content" v-if="o.log.progress!=0" v-html="o.log.log"></div>
			  	</div>
			</div>
		</DIV>
		<!--            翻 页          -->
		<load :url="'hwctask/task/get?id='+param('id')" data="task"></load>
		<page :url="'hwcuser/find?role=1&clsSn='+param('clsSn')" data="users"
			:join="'hwctask/taskLog/find?task.id='+param('id')" on="id=inUser.id===>log"></page>
		
	</main>
	<script type="text/javascript">
		var uid = '[[${session?.loginedUser?.id}]]';
		var v = vue("main","users","task",{
			updated(){
				layui.element.render();
			},
			methods:{
				c(o){
					o.state=1;
					o.checkAt = castDateFormat(new Date());
					post("task/taskLog/save", usp(o,"inUser","id","task","id","finishAt",null));
				}
			}
		});
		
	</script>
	<!-- 导入页脚 -->
	<footer th:replace="index::footer"></footer>
</BODY>
</HTML>
